# Copyright 2019 The KerasTuner Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest


def test_kerastuner_same_as_keras_tuner():
    with pytest.deprecated_call():
        import kerastuner
        from kerastuner.tuners import RandomSearch  # noqa: F401
        from kerastuner.tuners import BayesianOptimization  # noqa: F401
        from kerastuner.tuners import Hyperband  # noqa: F401
        from kerastuner.engine.base_tuner import BaseTuner  # noqa: F401
        from kerastuner.engine.conditions import Condition  # noqa: F401
        from kerastuner.engine.hypermodel import HyperModel  # noqa: F401
        from kerastuner.engine.hyperparameters import (  # noqa: F401
            HyperParameter,
        )
        from kerastuner.engine.hyperparameters import (  # noqa: F401
            HyperParameters,
        )
        from kerastuner.engine.metrics_tracking import (  # noqa: F401
            MetricObservation,
        )
        from kerastuner import Objective  # noqa: F401
        from kerastuner.engine.oracle import Oracle  # noqa: F401
        from kerastuner.engine.tuner import Tuner  # noqa: F401
        from kerastuner.engine.stateful import Stateful  # noqa: F401
        from kerastuner.engine.trial import Trial  # noqa: F401
        from kerastuner.engine.multi_execution_tuner import (  # noqa: F401
            MultiExecutionTuner,
        )
        from kerastuner.applications import HyperResNet  # noqa: F401
        from kerastuner.applications import HyperXception  # noqa: F401

    import keras_tuner

    attr1 = [attr for attr in dir(kerastuner) if not attr.startswith("__")]
    attr2 = [attr for attr in dir(keras_tuner) if not attr.startswith("__")]

    assert len(attr1) > 20
    assert set(attr1) >= set(attr2)
